%h2 Kanban Panes

- if params[:errors]
  #errorExplanation
    -params[:errors].each do |e|
      %li= "#{h e}"

-panes = controller.panes(@kanban)
-if !panes.nil?
  %table{:id => "pane-list-table",:class => "list"}
    %thead
      %th= l(:label_position)
      %th= l(:field_name)
      %th= l(:label_wip_limit)
      %th= l(:label_kanban_panes)
      %th= l(:label_role)
      %th= l(:field_description)
    %tbody
      -panes.each do |p|
        %tr{:id => "#{p.id}",:class => "#{cycle 'odd', 'even'}"}
          %td=h(p.position)
          %td=h(p.name)
          %td= p.wip_limit_auto? ? h("auto") : h(p.wip_limit)
          %td=h(p.kanban_state.name)
          %td=h(p.role.name)
          %td=h(p.description)
          %td{:class => "buttons"}
            %em.info.error{:style => "display:none"} "Destroy failed!"
            - if User.current.allowed_to?(:manage_categories, @project)
              = link_to l(:button_edit), edit_project_kanban_kanban_pane_path(@project.id,@kanban.id,p.id), :class => 'icon icon-edit'
              = delete_link project_kanban_kanban_pane_path(@project.id,@kanban.id,p.id)
- else
  %p{:class => "nodata"}= l(:label_no_data)

%p.hidden{:id => "save-button"}
  = submit_tag l(:button_save)
  %em.info.error{:style => "display:none"} "Save failure!"
%p= link_to l(:label_kanban_pane_new), new_project_kanban_kanban_pane_path(@project.id,@kanban.id), :class => 'icon icon-add' if User.current.allowed_to?(:manage_categories, @project)
